package com.seele.tigerwallet.ui.activtiy;

import android.os.Handler;
import android.support.annotation.FloatRange;
import android.support.annotation.Nullable;
import android.support.v4.hardware.fingerprint.FingerprintManagerCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.seele.tigerwallet.DemoFragment;
import com.seele.tigerwallet.R;
import com.seele.tigerwallet.ui.MainActivity;
import com.seele.tigerwallet.ui.base.BaseActivity;
import com.seele.tigerwallet.ui.base.TitleBaseActivity;
import com.seele.tigerwallet.ui.base.ToolbarBaseActivity;
import com.seele.tigerwallet.ui.fragment.AssetsFragment2;
import com.seele.tigerwallet.ui.utils.FingerprintUtils;
import com.seele.tigerwallet.ui.utils.SPUtils;
import com.seele.tigerwallet.ui.utils.StatusBarUtils;
import com.seele.tigerwallet.ui.views.AVLoadingIndicatorView;

public class DemoActivity  extends AppCompatActivity {

    private AVLoadingIndicatorView avi;

    private DemoFragment demoFragment;
    private FingerprintUtils mFingerprintUtils;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo);
        init();
    }

    private void init() {
        StatusBarUtils.with(this).init();
        getSupportFragmentManager().beginTransaction().replace(R.id.main_ll,new DemoFragment()).commit();
        mFingerprintUtils=new FingerprintUtils();
        mFingerprintUtils.init(this);
        mFingerprintUtils.handlerFingerprint();
     }



    /**
     * 指纹时间回调
     */
    private void setFingerprint() {
        mFingerprintUtils.setFingerprintListener(new FingerprintUtils.OnFingerprintListener() {
            @Override
            public void onHardwareDetected(boolean hardwareDetected) {
                if (!hardwareDetected) {
//                    mFingerprintRv.setVisibility(View.GONE);
                } else {
//                    mFingerprintRv.setVisibility(View.VISIBLE);
                }
            }

            @Override
            public void onEnrolledFingerprints(boolean b) {

            }

            @Override
            public void onAuthenticationError(int errorCode, CharSequence errString) {

            }

            @Override
            public void onAuthenticationHelp(int helpCode, CharSequence helpString) {


            }

            @Override
            public void onAuthenticationSucceeded(FingerprintManagerCompat.AuthenticationResult result) {

            }

            @Override
            public void onAuthenticationFailed() {



            }
        });
    }



}
